package com.foruo.learn.designmode.memo;

/**
 * 状态类
 * @author GaoYuan
 * @date 2018/11/13 上午8:25
 */
public class State {

    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    /** 获取当前状态，封装成备忘录类 */
    public Memo getMemo(){
        return new Memo(this.state);
    }

    /** 从备忘录中获取状态 */
    public void getStateFromMemo(Memo memo){
        this.state = memo.getState();
    }

}
